package com.idealighter.game.server.db.datadb.generate.mapper;

import com.idealighter.game.server.db.datadb.generate.domain.RoomCardGroupMemberDomain;
import com.idealighter.game.server.db.datadb.generate.domain.RoomCardGroupMemberDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface RoomCardGroupMemberDomainMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @SelectProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="countByExample")
    long countByExample(RoomCardGroupMemberDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @DeleteProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="deleteByExample")
    int deleteByExample(RoomCardGroupMemberDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Delete({
        "delete from room_card_group_member",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Insert({
        "insert into room_card_group_member (player_id, player_super_id, ",
        "player_avatar, player_name, ",
        "group_id, join_time, ",
        "leave_time, role)",
        "values (#{playerId,jdbcType=BIGINT}, #{playerSuperId,jdbcType=BIGINT}, ",
        "#{playerAvatar,jdbcType=VARCHAR}, #{playerName,jdbcType=VARCHAR}, ",
        "#{groupId,jdbcType=INTEGER}, #{joinTime,jdbcType=TIMESTAMP}, ",
        "#{leaveTime,jdbcType=TIMESTAMP}, #{role,jdbcType=TINYINT})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(RoomCardGroupMemberDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @InsertProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(RoomCardGroupMemberDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @SelectProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_super_id", property="playerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_avatar", property="playerAvatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="player_name", property="playerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="group_id", property="groupId", jdbcType=JdbcType.INTEGER),
        @Result(column="join_time", property="joinTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="leave_time", property="leaveTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="role", property="role", jdbcType=JdbcType.TINYINT)
    })
    List<RoomCardGroupMemberDomain> selectByExample(RoomCardGroupMemberDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Select({
        "select",
        "id, player_id, player_super_id, player_avatar, player_name, group_id, join_time, ",
        "leave_time, role",
        "from room_card_group_member",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_super_id", property="playerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_avatar", property="playerAvatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="player_name", property="playerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="group_id", property="groupId", jdbcType=JdbcType.INTEGER),
        @Result(column="join_time", property="joinTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="leave_time", property="leaveTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="role", property="role", jdbcType=JdbcType.TINYINT)
    })
    RoomCardGroupMemberDomain selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @UpdateProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") RoomCardGroupMemberDomain record, @Param("example") RoomCardGroupMemberDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @UpdateProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") RoomCardGroupMemberDomain record, @Param("example") RoomCardGroupMemberDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @UpdateProvider(type=RoomCardGroupMemberDomainSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(RoomCardGroupMemberDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group_member
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Update({
        "update room_card_group_member",
        "set player_id = #{playerId,jdbcType=BIGINT},",
          "player_super_id = #{playerSuperId,jdbcType=BIGINT},",
          "player_avatar = #{playerAvatar,jdbcType=VARCHAR},",
          "player_name = #{playerName,jdbcType=VARCHAR},",
          "group_id = #{groupId,jdbcType=INTEGER},",
          "join_time = #{joinTime,jdbcType=TIMESTAMP},",
          "leave_time = #{leaveTime,jdbcType=TIMESTAMP},",
          "role = #{role,jdbcType=TINYINT}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(RoomCardGroupMemberDomain record);
}